package forstu

import "fmt"

func Fo(count int) {

	//最简答的循环
	for i := 0; i < count; i++ {
		fmt.Println("简单循环 ", i)
	}

	//死循环
	for {
		if count < 0 {
			fmt.Println("退出死循环")
			break
		}
		fmt.Println("死循环 count is ", count)
		count--
	}

}

func RangeSt() {
	//定义数组
	as := [3]int{5, 6, 7}
	for index, value := range as {
		fmt.Printf("range循环数组,下标: %d , 值: %v \n", index, value)
		//值传递 这里不会改变原来的值
		value++
		//修改原始位置的值
		as[index] += 1
	}
	fmt.Println(as)
}
